<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>注册 - AI简历分析系统</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        .container {
            max-width: 500px;
            margin-top: 50px;
        }
        .error-message {
            color: #dc3545;
            margin-bottom: 15px;
            text-align: center;
        }
        .form-group {
            margin-bottom: 1.5rem;
        }
    </style>
</head>
<body>
<div class="container">
    <h2 class="text-center mb-4">用户注册</h2>

    <!-- 显示错误信息 -->
    <div th:if="${error}" class="alert alert-danger error-message">
        <p th:text="${error}"></p>
    </div>

    <form th:action="@{/register}" method="post">
        <div class="form-group">
            <label for="username">用户名</label>
            <input type="text" class="form-control" id="username" name="username"
                   placeholder="请输入用户名（4-20个字符）" required>
        </div>

        <div class="form-group">
            <label for="password">密码</label>
            <input type="password" class="form-control" id="password" name="password"
                   placeholder="请输入密码（至少6位）" required>
        </div>

        <div class="form-group">
            <label for="confirmPassword">确认密码</label>
            <input type="password" class="form-control" id="confirmPassword" name="confirmPassword"
                   placeholder="请再次输入密码" required>
        </div>

        <button type="submit" class="btn btn-primary w-100">注册</button>
    </form>

    <div class="text-center mt-3">
        已有账号？<a th:href="@{/login}">立即登录</a>
    </div>
</div>
</body>
</html>
